import base64

# 初始化客户端
client = FileStorageClient(base_url="http://localhost:8080/file")

# 上传文件
client.push_file("D:/test.bin", "upload/test.bin")

# 下载文件
client.pull_file("upload/test.bin", "D:/downloaded_test.bin")

# 上传内存数据
data = b"这是要上传的二进制数据..."
client.push_data(data, "upload/memory_data.bin")

# 下载内存数据
received_data = client.pull_data("upload/memory_data.bin")
if received_data:
    print("收到数据长度:", len(received_data))
    print("原始数据:", received_data.decode())